package main.graph;

import java.util.HashMap;

import y.base.Edge;

import main.model.OntoNodePair;
import main.model.Tree2OntoMapping;

/**
 * 
 * represents a form tree with a mpping to an ontology
 * 
 * @author YuanAn
 *
 */
public class FormTreeWithMapping extends ValuedGraph {
	private Tree2OntoMapping mapping;
	
	private HashMap<Edge, OntoNodePair> edgeToTwoEnds; //holds the two ends of an edge
	
	public FormTreeWithMapping(){
		super();
		mapping = new Tree2OntoMapping(this);
		
		edgeToTwoEnds =  new HashMap<Edge, OntoNodePair>();
	}
	
	
	//getter and setter
	public Tree2OntoMapping getMapping(){
		return mapping;
	}
	
	public void setMapping(Tree2OntoMapping mapping){
		this.mapping = mapping;
	}
	
	public void putEdgeToTwoNodes(Edge e, OntoNodePair ends){
		edgeToTwoEnds.put(e, ends);
	}
	
	public OntoNodePair getTwoEnds(Edge e){
		return edgeToTwoEnds.get(e);
	}
}
